package org.zcl.字符操作与数据计算;

/**
 * @PROJECT_NAME:
 * @DESCRIPTION:
 * @USER: ZhuChengLin
 * @DATE: 2021/11/23 16:37
 */
public class MathDemo {

    public static void main(String[] args) {
        double d1 = -0.5;
        System.out.println("Ceil d1=" + Math.ceil(d1));
        System.out.println("floor d1=" + Math.floor(d1));
        // +0.5向下取整
        System.out.println("round d1=" + Math.round(d1));

        System.out.println("计算30度（角度）的余弦值=" + Math.cos(Math.toRadians(30)));
        System.out.println("根号=" + Math.sqrt(3) / 2);
        System.out.println("度数=" + Math.toDegrees(Math.PI / 2));
        System.out.println("弧度值=" + Math.toRadians(30));
        System.out.println("绝对值=" + Math.abs(-20));
        System.out.println("求幂=" + Math.pow(2, 3));
        System.out.println("log=" + Math.log(8));
        System.out.println("log10=" + Math.log10(100000));

    }
}
